<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%> 
<html>
<head>  
  <script type="text/javascript">
	$(function(){
		  $.ajax({
			  type: 'POST',
			  url: "../channelinf/getChannelByTp.do?chn_tp=1",				  
			  success: function(data) {	
				  var msg = [];
				  msg.push({ "id": "", "text": "---请选择---" });
				  for(var i=0;i<data.length;i++){
					 msg.push({ "id": data[i].ID, "text": data[i].TEXT });				  
				  }			 
				  $("#channel_no").combobox({
					   	data:msg,
					    valueField:'id',
					    textField:'text',
					    panelHeight:'auto',
					    onLoadSuccess:function(param){
					    	var channel_no="";
					    	if(param.length>0){
					    		channel_no=param[0].id;			    		
					    	}
					    }
					});		  
		      }
		  });	
		//加载业务名称数据
		$('#service_uuid').combobox({
	        url:"../serviceParam/getAllService.do",
	        valueField:'SERVICE_UUID',
	        textField:'SERVICE_NAME',
	        editable:false,
	        onChange:function(record){
	                var value = $('#service_uuid').combobox('getValue');
	                loadServiceParamsInf(value);
	        }
		});
		
		$("#service_param_uuid").combobox({
			onShowPanel : function () {
				if($("input[name='service_uuid']").val() == '' || $("input[name='service_uuid']").prev().val() == ''){
					$.jpmessage.warning("请先选择业务名称！");
					$(this).combo('hidePanel', true);
				}
 			}
 		});
	});
	
	/**
	 *点击业务的时候载入业务参数数据
	 */
	function loadServiceParamsInf(value) {
		$('#service_param_uuid').combobox('clear');
		$('#service_param_uuid').combobox('reload',
				'../serviceParam/getAllServiceParams.do?service_uuid=' + value)
	}
  
  function doSearch() {	 
	  grid.load({
			custom_no : $('#custom_no').val(),
			custom_name : $('#custom_name').val(),
			custom_login_id : $('#custom_login_id').val(),
			channel_No: $('#channel_no').val(),
			service_no: $('#service_uuid').val(),
			param_no: $('#service_param_uuid').val()
		});
  }
  var grid;
  $(document).ready(function() {
	  grid = $("#channelinfTableId").jpgrid({
			url: "getInfChnCustomServiceListJson.do",
			columns: [
				{title: "会员编号", field: "CUSTOM_NO",width:150},
				{title: "会员名称", field: "CUSTOM_NM",width:150},
				{title: "业务编号", field: "SERVICE_NM", width:150},
				{title: "参数编号", field: "PARAM_NM", width:150},
				{title: "贷记卡扣率", field: "CREDIT_MIN_RATE", width:110},
				{title: "贷记卡附加手续费", field: "CREDIT_MIN_ATTACHFEE",width:150},
				{title: "贷记卡最小手续费", field: "CREDIT_MIN_FEE",width:150},
				{title: "贷记卡最大手续费", field: "CREDIT_MIN_MAXFEE",width:110},
				{title: "通道编号", field: "CHANNEL_NM",width:150}
			]
		});	  
  });
  </script>
</head>
<body class="easyui-layout list_body"  >
	<form id="channelinfForm" name="channelinfForm">
		<div class="list_body_north" data-options="region:'north'"  border="false" >
			<!-- 查询表单 -->
			<div  class="datagrid-toolbar" border="false"  >
				<span>会员编号:</span>
				<input type="text" id="custom_no" name="custom_no" class="easyui-textbox" />
				<span>会员名称:</span> 
				<input type="text" id="custom_name" name="custom_name" class="easyui-textbox" />
				<span>会员手机号:</span>
				<input type="text" id="custom_login_id" name="custom_login_id" class="easyui-textbox" />
				<span>通道编号:</span>
				<input id="channel_no" type="text" name="channel_no"  class="easyui-textbox"  >
				<br/>
				<span>业务名称:</span>
				<input class="easyui-combobox" type="text" name="service_uuid" id="service_uuid"  >
				<span>业务参数名称:</span>
				<input class="easyui-combobox" type="text" name="service_param_uuid" id="service_param_uuid" 
						data-options="valueField:'SERVICE_PARAM_UUID', textField:'PARAM_NAME',editable:false," >		
			 	<a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch() ">查询</a>
			 	<a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm() ">重置</a>				
			</div>
			<!-- 自定义标签工具栏 -->
			<jiepos:buttonOperateTag menuCode="${menuCode}"></jiepos:buttonOperateTag>	
		</div>
		<div data-options="region:'center'" border="false"  class="list_body_center">		
			<!-- 表格 -->
			<table id="channelinfTableId" fit="true"></table>
		</div>
	</form>
</body>
 </html>
